package org.example;

/**
 * 订单类
 */
public class Order {
    private double amount;
    private PaymentStrategy paymentStrategy;

    public Order(double amount, PaymentStrategy paymentStrategy) {
        this.amount = amount;
        this.paymentStrategy = paymentStrategy;
    }

    //支付操作
    public void processPayment(){
        paymentStrategy.pay(amount);
    }
}
